import SystemDataSys from "./SystemDataSys";
import PeripheralSystemDataMgr from "./PeripheralSystemDataMgr";
import HotUpdate from "./HotUpdate";
import SdkHelper from "./SdkHelper";
import BaseSystem from "./BaseSystem";
import EngineUtil from "./EngineUtil";
import BasePageCtrl, { AnimType } from "./BasePageCtrl";
import UiManage from "./UiManage";
import GameDataMgr from "./GameDataMgr";
import WebPage from "./WebPage";

const { ccclass, property, menu } = cc._decorator;

@ccclass
@menu("UI/pages/WebPageCtrl")
// export default class WebPageCtrl extends BasePageCtrl {
//     @property(WebPage)
//     ui = null;

//     onLoad() {
//         super.onLoad();
//         this.onUILoad();
//         this._animType = AnimType.NONE;
//         this._touchControl = false;
//         this._hasPeneLock = true;
//         this._hasBlack = true;
//         this._hasTouchLock = false;
//         this.addButtonListen();
//     }

//     start() {}

//     onUILoad() {
//         this.ui = this.node.addComponent(WebPage);
//     }

//     _init(e?) {
//         if (p.getLocalData("user_agreement")) {
//             SdkHelper.openAgreementPage();
//         }
//         const url = e.url;
//         const type = e.type;
//         let a = "";
//         const o = !HotUpdate.getInstance().isOnlineRelease();
//         let i;
//         if (type === GameDataMgr.WebUrlType.USER_TYPE) {
//             i = SystemDataSys.user_url + "&debug=" + o;
//             a = "user";
//             cc.sys.localStorage.setItem("user_LastAgreement", i);
//         } else if (type === 1) {
//             i = SystemDataSys.privacy_url;
//             a = "privacy";
//             cc.sys.localStorage.setItem("user_LastPrivacy", i);
//         }
//         i += this.getFdStatus();
//         this.ui.web.getComponent(cc.WebView).url = i;
//         if (p.getLocalData("user_agreement")) {
//             BaseSystem.agreementReport({
//                 url: i.replace(/\&/g, "%26"),
//                 type: a
//             });
//         }
//     }

//     getFdStatus() {
//         return PeripheralSystemDataMgr.getFdStatus() ? "&fd=0" : "&fd=1";
//     }

//     addButtonListen() {
//         UiManage.addButtonListen(this.ui.btn_close, this.clickClose, this);
//     }

//     clickClose() {
//         this.hide();
//     }

//     static prefabUrl = "WebPage";
//     static className = "WebPageCtrl";
// }
